
package com.zkmonitor.biz;

import com.zkmonitor.dao.NodeDAO;
import com.zkmonitor.exception.ShepherException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class NodeBiz {

    @Autowired
    private NodeDAO nodeDAO;

    public void update(String cluster, String path, String data, long snapshotId) throws ShepherException {
        nodeDAO.update(cluster, path, data,  null);
    }

    public void update(String cluster, String path, String data) throws ShepherException {
        nodeDAO.update(cluster, path, data, null);
    }

    public void create(String cluster, String path, String data) throws ShepherException {
        nodeDAO.create(cluster, path, data);
    }

    public void create(String cluster, String path, String data, boolean createParents)throws ShepherException {
        nodeDAO.create(cluster, path, data, createParents);
    }

    public void createEphemeral(String cluster, String path, String data) throws ShepherException{
        nodeDAO.createEphemeral(cluster, path, data);
    }

    public void delete(String cluster, String path) throws ShepherException {
        nodeDAO.delete(cluster, path);
    }
}
